<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Cate;
class CateController extends Controller
{
    //返回所有启用的栏目
    function cates(){
        $cate_model = new Cate();
        $cates = $cate_model->get_all_cates()->toArray();
        //添加“限时秒杀”栏目作为首页。
        $index = [
            'id'    =>  0,
            'name'  =>  INDEX
        ];
        array_unshift($cates,$index);
        return $this->response(0,$cates);
    }
}
